/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package CapaLogica;

import CapaAccesoBD.Conector;
import java.util.ArrayList;

/**
 *
 * @author Amejia
 */
public class MultiGuia {
    

        public Guia buscarPorCodigo(String pcodigo) throws Exception{
            Guia objGuia=null;
            String sql;
            java.sql.ResultSet rs;
            sql = "SELECT * " + 
                  " FROM TGuia" + 
                  "WHERE Id = '"+pcodigo+"';";
            try{

                rs = Conector.getConector().ejecutarSQL(sql,true);
                if(rs.next())
                    objGuia = new Guia(rs.getString("Id"), rs.getString("nombre"), rs.getString("direccion"),rs.getString("celular"),rs.getString("idCongregacion"));

            }catch (Exception e){ 
                throw new Exception (e.getMessage());
            }
            rs.close();
            
            return objGuia;
        }
}
